﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using YouErYuanManage.Filter;

namespace YouErYuanManage
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RegisterGlobalFilters(GlobalFilters.Filters);//注册过滤器
            RouteConfig.RegisterRoutes(RouteTable.Routes);           
        }

        /// <summary>
        /// 全局注册过滤器
        /// </summary>
        /// <param name="filters"></param>
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            //filters.Add(new HandleErrorAttribute());
            filters.Add(new logExceptionAttribute());//添加异常过滤器
        }
    }
}
